class PrivatePopsicle < Popsicle
	belongs_to :entity, :foreign_key => 'private_author_id'
	
	has_many :receive_messages
	has_many :recipients, :through => :receive_messages
	
	def create_response(entity_id,content) #Created by Adrian, Edited by Michael
		#PrivatePopsicle.create(:private_author_id => entity_id, :subject => self.subject, :prev_popsicle => self.id, :content => content)
		
		ReceiveMessage.create(:entity_id => self.private_author_id, :popsicle_id => PrivatePopsicle.create(:private_author_id => entity_id, :content => content, :subject => self.subject).id)
	end
end
